package it.irondev.appturismo.rest;

import it.irondev.appturismo.entity.Accomodation;
import it.irondev.appturismo.service.IAccomodationsService;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Path("/accomodations")
public class RestAccomodation {
	
	@Autowired
	IAccomodationsService service;
	
	@GET
	@Path("/list/{param}")
	@Produces("application/json")
	public Response listAccomodations(@PathParam("param") String queryString) {
		System.out.println(queryString);
		List<Accomodation> accomodations =service.getAllAccomodations();
		return Response.status(200).entity(accomodations).build();
	}

}
